﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using CRM_SMS_MARKETING.PL.Customer;
using System.Collections;
using GSM.BusinessLayer.DataLayer;

namespace CRM_SMS_MARKETING.PL.Message
{
    public partial class frmCompose : DevExpress.XtraEditors.XtraForm
    {
        frmContact frmContact;
        List<SmsControl.SmsControl> list_Modem;
        List<GSM.BusinessLayer.Customer> ListCustomer;
        CustomerSql customersql;
        public frmCompose()//List<SmsControl.SmsControl> List_Modem)
        {
            InitializeComponent();
            //list_Modem = List_Modem;
            ListCustomer = new List<GSM.BusinessLayer.Customer>();
            frmContact = new frmContact(this);
        }

        private void frmTestDragDrop_Load(object sender, EventArgs e)
        {
        
            dataGridViewCustomer.AllowDrop = true;

            dataGridViewCustomer.DragDrop += new DragEventHandler(dataGridViewCustomer_DragDrop);

            dataGridViewCustomer.DragOver += new DragEventHandler(dataGridViewCustomer_DragOver);
   
        }
        private void dataGridViewCustomer_DragOver(object sender, DragEventArgs e)
        {

            e.Effect = DragDropEffects.Move;

        }
        private void dataGridViewCustomer_DragDrop(object sender, DragEventArgs e)
        {
            if (e.Effect == DragDropEffects.Move)
            {

                for (int i = frmContact.arrmove.Count - 1; i >= 0; i--)
                {

                    ArrayList rowvalue = (ArrayList)frmContact.arrmove[i];

                    dataGridViewCustomer.Rows.Add(rowvalue[0], rowvalue[1],rowvalue[2],rowvalue[3],rowvalue[4]);

                }

                frmContact.removeRow();

            }

        }
        private void btnContact_Click(object sender, EventArgs e)
        {
            frmContact.Show();

        }

    }
}